﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HS.EIP.WatchService
{
    public class ServiceWatchOptions
    {
        /// <summary>
        /// 延迟启动时间（秒）
        /// </summary>
        public int StartupDelay { get; set; }
        /// <summary>
        /// 每一轮监控的间隔时间（秒）
        /// </summary>
        public int WatchInterval { get; set; }
        public Service[] Services { get; set; }
        public MailServerOptions MailServer { get; set; }
    }
    public class Service
    {
        /// <summary>
        /// 是否启动服务
        /// </summary>
        public bool Enable { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 健康检查次数  -1：表示无限次循环健康检查 0：表示不做健康检查  大于0：表示指定的检查次数
        /// </summary>
        public int Loop { get; set; }

        /// <summary>
        /// 健康检查路径。
        /// </summary>
        public string Health { get; set; }

        /// <summary>
        /// 健康检查失败循环间隔时间（秒）
        /// </summary>
        public int Interval { get; set; }

        public string Name { get; set; }
        public string Category { get; set; }

        public int WaitForExit { get; set; }

        /// <summary>
        /// 启动成功后延时（秒）
        /// </summary>
        public int Delay { get; set; }
   
    }
    public class MailServerOptions
    {
        public bool Enable { get; set; }
        public string Host { get; set; }
        public int Port { get; set; }
        public bool UseSsl { get; set; }
        public string SendAccount { get; set; }
        public string Password { get; set; }
        public string[] Rreceivers { get; set; }
    }
}
